/*
 * @Author: 高瑞寒 15932717091@163.com
 * @Date: 2022-05-11 00:31:43
 * @LastEditTime: 2022-05-16 02:12:35
 * @LastEditors: 高瑞寒 15932717091@163.com
 * @Description: 
 */
export const setItem = (name, data) => {
  if (typeof data === 'object') {
    return localStorage.setItem(name, JSON.stringify(data))
  }
  localStorage.setItem(name, data)
}
export const getItem = (name) => {
    if(localStorage.getItem(name)){
      return JSON.parse(localStorage.getItem(name))
    }else{
      return {}
    }
  
}
export const clearAllItem = () => {
  localStorage.clear()
}